package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

public class Demo1 {

	public static void main(String[] args) {
		ArrayList<String> a1=new ArrayList<>();
		List<String> a2=new ArrayList<>();
		Collection<String> a3=new ArrayList<>();
		
		a2.add("aabc");
		a2.add("addb");
		a2.add("ba");
		a2.add("bbc");
		System.out.println("\n--------------------");
		for(int i=0;i<a2.size();i++)
			System.out.print(a2.get(i)+" ");
		System.out.println("\n--------------------");
		Iterator<String> it=a2.iterator();
		while(it.hasNext()){
			System.out.print(it.next()+" ");
		}
		System.out.println("\n--------------------");
		for(String s:a2){
			System.out.print(s+"  ");
		}
	}

}
